home *** CD-ROM | disk | FTP | other *** search
- Path: chronicle.mti.sgi.com!news
- From: austern@isolde.mti.sgi.com (Matt Austern)
- Newsgroups: comp.lang.c++
- Subject: Re: Will JAVA kill C++?
- Date: 08 Mar 1996 20:14:19 GMT
- Organization: SGI
- Message-ID: <AUSTERN.96Mar8121419@isolde.mti.sgi.com>
- References: <313E44EA.14D110C0@netcom.com> <4hp18v$3di@frodo.smartlink.net>
- <4hq2j6$q93@galaxy.ucr.edu>
- Reply-To: austern@mti.sgi.com
- NNTP-Posting-Host: isolde.mti.sgi.com
- In-reply-to: thp@cs.ucr.edu's message of 8 Mar 1996 19:42:30 GMT
-
- In article <4hq2j6$q93@galaxy.ucr.edu> thp@cs.ucr.edu (Tom Payne) writes:
-
- > : I still think the C++ program would be quicker and more efficient -- There
- > : are still some things you will not be able to do in JAVA, such as
- > : pointers. And anyone who believes arrays can do anything a real pointer
- > : can does not know what they are talking about and probably does not know
- > : how to program very well.
- >
- > When one is interested in speed, one should avoid pointers (as
- > does. Fortran), since pointers kill opportunities for optimization.
-
- The problem with Java isn't that it has no pointers, but, rather, that
- it makes it impossible to avoid pointers. All references to primitive
- types in Java are by value (i.e., not using pointers), and all
- references to class types are by reference (i.e., using pointers).
-
- In C++, or Fortran, or Eiffel, you can have an array of complex
- numbers. In Java, though, you can't: you can have something that
- looks like an array of complex numbers, but internally it's really an
- array of pointers to complex numbers. You have to pay a space penalty
- to store those pointers, and a time penalty to do the dereferencing on
- every element, and the optimizer will have to generate code on
- assumption that two array elements might point to the same object.
- --
- Matt Austern
- SGI: MTI Compilers Group
- austern@isolde.mti.sgi.com
-